#include "Dofs.h"
#include <iostream>
#include <set>
using namespace std;

int main()
{
    vector<double> p1 = {1.0, 2.0};
    Point<2> P1(p1);
    Point<2> P2({2.0, 3.0});
    Dofs<2> D1(P1, 2);
    Dofs<2> D2(P2, 3);
    Dofs<2> D3(P2, 3);
    cout << D1.getGlobalIndex() << endl;
    D1.setGlobalIndex(4);
    cout << D1.getGlobalIndex() << endl;
    cout << D1 << "的x分量为" << D1[1] << endl;
    if (D1 < D2)
        cout << (D1 >= D2) << endl;
    vector<Dofs<2>> v = {D1, D1, D2, D3};
    cout << "去重前:" << endl;
    for (auto &it : v)
        cout << it << ", ";
    cout << endl;
    sort(v.begin(), v.end());
    v.erase(unique(v.begin(), v.end()), v.end());
    cout << "去重后:" << endl;
    for (auto &it : v)
        cout << it << ", ";
    cout << endl;

    set<Dofs<2>> s;
    s.insert(D1);
    s.insert(D2);
    return 0;
}
